package com.ruoyi.common.utils;

import org.apache.commons.lang.math.RandomUtils;

public class CodeUtil {

	/**
	 * 获取随机串
	 * 
	 * @param length
	 * @return
	 */
	public static String get(int length) {
		String base = "abcdefghijklmnopqrstuvwxyz0123456789";
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < length; i++) {
			int number = RandomUtils.nextInt(base.length());
			sb.append(base.charAt(number));
		}
		return sb.toString();
	}
}
